<template>
  <div class="recharge-wrapper non-shopcard-wrapper">
    <div class="non-shopcard"
         v-if="!is_recharge || shop_info.qipay_open">
      <div class="form1">
        <div class="rechargeitem">
          <div class="item-box recharge-type"
               v-if="is_dhs_allow_deposit && is_dhs_allow_deposit != 0">
            <label class="item-title" style="display:inline">充值类型：</label>
            <div class="item-label">
              <van-radio-group @change="handleChangeRecharge"
                               checked-color="#F20B22"
                               v-model="submitData.recharge_type">
                <van-radio v-if="is_deposit_to_balance == 1"
                           icon-size="15px"
                           :name="1"><span class="radio-txt">账户余额</span></van-radio>
                <van-radio v-if="is_show_deposit_recharge == 1"
                            icon-size="15px"
                           :name="2"><span class="radio-txt">订货商预存款</span></van-radio>
              </van-radio-group>
            </div>
          </div>
          <div class="item-box recharge-num">
            <p class="item-title">充值金额</p>
            <label for
                   class="clearfix recharge-search">
              <i class="fl">{{mSymbol.name}}</i>
              <input type="text"
                     v-model="submitData.payment"
                     name="payment"
                     :placeholder="placeholder" />

            </label>
          </div>
          <!-- 上传凭证 -->
          <!-- <transition name="van-slide-left">
            <div class="item-box recharge-num" v-if="paymentWay == 'xxpay' && needProof == 1 && (submitData.recharge_type != 2 || dzYckType>0)">
              <p class="item-title">上传凭证</p>
              <SmallUploadImg ref="smallUploadImgPz" :maxLength="1" :isUploadCzPz="true" sfzBg="https://img.wifenxiao.com/h5-wfx/images/scpz.png"></SmallUploadImg>
            </div>
          </transition> -->

          <!-- 线下付款富文本内容 -->
          <div class="item-box gathering-info" v-show="paymentWay == 'xxpay' && (submitData.recharge_type != 2)">
            <div v-html="gathering_info" class="gathering-info-fulltext"></div>
          </div>

          <section class="item-box show-tip clearfix">
            <div class="title-info"
                 v-if="is_show==1">
              <p class="item-title">支付方式</p>
            </div>

            <template v-if="ltnsStatus">
               <payment ref="payments"
                  :isHdfkPay='false'
                  :isRecharge= true
                  :isRechargeTl="isRechargeTl"
                  :tlInfobz="tlInfobz"
                  @globalAlipay="globalAlipay"
                  @paymentData="paymentData"
                  v-model="paymentWay">
                </payment>
            </template>
            <template v-else>
              <payment ref="payments"
                :isHdfkPay='false'
                :isTlfzPay="true"
                :isRechargeTl="isRechargeTl"
                :tlInfobz="tlInfobz"
                :isHffzPay="true"
                :isJhPay="true"
                @globalAlipay="globalAlipay"
                @paymentData="paymentData"
                v-model="paymentWay">
              </payment>
            </template>
          </section>

          <section class="item-box show-tip clearfix">
            <div class="title-info"
                 v-if="is_show==1">
              <p class="log-title">充值优惠提醒</p>
            </div>

            <section class="tip-txt"
                     v-if="is_show">
              <div class="tip-txt-detail"
                   ref="tipDetail"
                   :class="showMoreInfo ? 'heightAuto': ''">
                <ul>
                  <div v-if="is_recharge_sum && recharge_list">
                    <li v-for="(item,index) in recharge_list" :key="index">每充值{{item.amount}}元送{{item.num}}元</li>

                    <li v-if="is_recharge_point && recharge_point_amount && recharge_point_num">每充值{{recharge_point_amount}}元送{{recharge_point_num}}{{point_name}}积分</li>
                  </div>
                </ul>

                <ul v-if="user_recharge_list || agents || (is_recharge_coupon && recharge_coupon_list) || recharge_dls_list || recharge_dhs_list">
                  <!-- 充值成为会员 -->
                  <li v-for="(user,userindex) in user_recharge_list" :key="userindex" @click="showDesc(user.desc)">一次性充值{{user.amount}}元,会员等级升级为{{user.user_rank_name}}<i v-if="user.desc"></i></li>
                  <!-- 充值成为分销商 -->
                  <li v-for="(agent,agentindex) in agents" :key="agentindex" @click="showDesc(agent.desc)">
                    一次性充值{{agent.amount}}元,
                    <span v-if="agent.agent_rank_id">{{ftitle_agents}}等级升级为{{agent.rank}}</span>
                    <span v-else>成为{{ftitle_agents}}</span>
                    <i v-if="agent.desc"></i>
                  </li>
                  <!-- 充值成为代理商 -->
                  <li v-for="(row,rowindex) in recharge_dls_list" :key="rowindex" @click="showDesc(row.desc)">一次性充值{{row.amount}}元,{{ftitle_agencies}}等级升级为{{row.rank}}<i v-if="row.desc"></i></li>
                  <!-- 充值成为订货商 -->
                  <li v-for="(row,rowindex) in recharge_dhs_list" :key="rowindex" @click="showDesc(row.desc)"><span v-if="is_recharge_total_update == 0">一次性</span><span v-else>累计</span>充值{{row.amount}}元,{{dhs_alias}}等级升级为{{row.rank}}<i v-if="row.desc"></i></li>

                  <li v-for="(coupon,index) in recharge_coupon_list"
                      :key="index">
                    一次性充值{{ coupon.coupon_money }}元，赠送{{ coupon.promotion_type == 1 ? '折扣' : '面值' }}为{{ coupon.coupon_value }}{{ coupon.promotion_type == 1 ? '折' : '' }}的{{ ftitle_coupon_name }}
                    <b>【{{coupon.coupon_title}}】</b>
                  </li>
                </ul>
              </div>
              <div class="tip-txt-btn"
                   v-if="!showMoreInfo"
                   @click="showMoreInfo = true">
                <span>查看更多</span>
                <i class="icon-right"></i>
              </div>
            </section>
          </section>

          <div class="recharge-btn">
            <div class="red-gra-btn submit-btn"
                 @click="handleClickCharge">{{btnText}}</div>
          </div>
        </div>
      </div>
    </div>
    <!-- 备注 -->
    <van-popup
      v-model="dialogVisible"
      round
      closeable
      class="desc-pop"
      position="bottom"
    >
      <div class="desc-wrap">
        <div class="desc-title">备注</div>
        <div class="decs-content">{{dialogDesc}}</div>
        <div class="decs-close" @click="()=>{dialogVisible = false}">关闭</div>
      </div>
    </van-popup>
  </div>
</template>

<script>
import Vue from 'vue'
import { RadioGroup, Radio, Popup } from 'vant'
import { Uploader } from 'vant'
import small from '@/smallapp/small'
import SmallUploadImg from '@/components/SmallUploadImg'
import { openPage } from '@/utils/utils'

Vue.use(Uploader)
Vue.use(RadioGroup)
Vue.use(Radio)
Vue.use(Popup)
import smallpay from '@/smallapp/smallpay'
// import { uploadImgs } from '@/api/community/article'
import { isWeixinCient,isIOS } from '@/utils/validate'
import Store from '@/utils/store'
import { balanceRecharge } from '@/api/user/member/memberApi'
import Payment from '@/components/Payment'
import { mapGetters } from 'vuex'

export default Vue.extend({
  name: 'index',
  components: {
    Payment,
    SmallUploadImg
  },
  props: {
    rechargeData: {
      type: Object
    }
  },
  watch: {
    rechargeData(val) {
      this.placeholder = `${val.recharge_limit}${this.is_crossBorderDz ? this.mSymbol.name : '元'}起充`
      // 文字
      this.tlfz_have_person_signed = val.tlfz_have_person_signed
      this.point_name = val.point_name
      this.ftitle_agents = val.ftitle_agents
      this.ftitle_agencies = val.ftitle_agencies
      this.dhs_alias = val.dhs_alias
      this.ftitle_coupon_name = val.ftitle_coupon_name
      // 数字 值
      this.default_pay_type = val.default_pay_type
      this.is_dhs_allow_deposit = val.is_dhs_allow_deposit
      this.is_deposit_to_balance = val.is_deposit_to_balance
      this.now_dhs_rank = val.now_dhs_rank
      this.recharge_limit = val.recharge_limit
      this.recharge_code = val.recharge_code
      this.is_show = val.is_show
      this.is_recharge_sum = val.is_recharge_sum
      this.is_recharge_point = val.is_recharge_point
      this.recharge_point_amount = val.recharge_point_amount
      this.recharge_point_num = val.recharge_point_num
      this.is_recharge_coupon = val.is_recharge_coupon
      this.is_show_deposit_recharge = val.is_show_deposit_recharge
      this.is_recharge_total_update = val.is_recharge_total_update

      // 数组 列表
      this.recharge_list = val.recharge_list
      this.user_recharge_list = val.user_recharge_list
      this.agents = val.agents
      this.recharge_coupon_list = val.recharge_coupon_list
      this.recharge_dls_list = val.recharge_dls_list
      this.recharge_dhs_list = val.recharge_dhs_list
      if (this.is_dhs_allow_deposit && this.is_dhs_allow_deposit != 0) { // 订货商身份默认选中
        if (this.now_dhs_rank > 0) {
          this.submitData.recharge_type = 2
        } else {
          // 处理当后台关闭余额充值并且开启订货商预存款的时候充值类型默认选中订货商预存款,优化逻辑已与测试同步
          if (this.is_show_deposit_recharge == 1 && this.is_deposit_to_balance != 1) {
            this.submitData.recharge_type = 2
          } else {
            this.submitData.recharge_type = 1
          }
        }
        setTimeout(() => {
          this.handleChangeRecharge()
        }, 500)
      }

      if (this.is_show_deposit_recharge == 0) {
        this.submitData.recharge_type = 1
        setTimeout(() => {
          this.handleChangeRecharge()
        }, 500)
      }

      setTimeout(() => {
        const height = this.$refs.tipDetail.offsetHeight
        if (height < 120) {
          this.showMoreInfo = true
        }
      }, 100)
    }
  },
  data() {
    return {
      placeholder: '请输入充值金额',
      tip:'https://img.wifenxiao.com/h5-wfx/images/user/recharge/tip.png',
      // upImg: 'https://img.wifenxiao.com/h5-wfx/images/user/pzImg.png',
      submitData: {
        payment: '',
        recharge_type: 1,
        proof_path: ''
      },
      tlfz_have_person_signed: 0, // 是否开启实名认证
      showMoreInfo: false,
      paymentWay: 'wxpay',
      paymentDataAll: '',
      needProof: 0, // 上传凭证
      gathering_info: '', // 线下付款富文本信息
      is_recharge: 1,
      shop_info: {
        qipay_open: 1
      },
      point_name: '积分',
      ftitle_agents: '分销商1',
      ftitle_agencies: '代理商1',
      dhs_alias: '订货商1',
      ftitle_coupon_name: '优惠券',
      default_pay_type: '1',
      is_dhs_allow_deposit: 0, // 订货商预存款
      is_deposit_to_balance: 1,
      now_dhs_rank: 1,
      recharge_limit: '1', // 该等级订货商最低充值金额
      is_show: 1,
      is_recharge_sum: '1',
      recharge_list: [
        // {
        //   amount: 222,
        //   num: 2
        // }
      ],
      is_recharge_point: 0,
      recharge_point_amount: 0,
      recharge_point_num: 0,
      user_recharge_list: [
        // {
        //   amount: 222,
        //   user_rank_name: '一级'
        // }
      ],
      agents: [
        // {
        //   amount: 222,
        //   agent_rank_id: '11',
        //   ftitle_agents: 'qqq',
        //   rank: 'www'
        // }
      ],
      is_recharge_coupon: 1,
      recharge_coupon_list: [
        // {
        //   coupon_money: 222,
        //   coupon_value: 11,
        //   coupon_title: '优惠券名称1'
        // }
      ],
      recharge_dls_list: [
        // {
        //   amount: 222,
        //   rank: '2'
        // }
      ],
      recharge_dhs_list: [
        // {
        //   amount: 222,
        //   rank: '2'
        // }
      ],
      dzYckType: 0, // 奇异国预存款定制
      ltnsStatus: false, // 莱特妮丝
      dialogVisible: false,
      dialogDesc: '',
      is_recharge_total_update: 0,
      isRechargeTl: true, // 账户充值 开启通联分账的情况下 需要给后端一个标识
      tlInfobz: {
        is_tlfz: 0,
        is_tlfz_deposit: 0,
        is_ye: 0
      },
      hfAppId: '',
      remark: -1
    }
  },
  mounted() {
    if (small.wxCache('adapayPlugVersion') == 'jump_adapay_mini') {
      window.addEventListener('wxshow', () => {
        let options = wx.getEnterOptionsSync();
        // wx1e18d140f890f2c5，wx308088053f4ecc3a
        if (options.scene == '1038' && options.referrerInfo.appId == this.hfAppId && this.remark == 2) {
          // 代表从收银台小程序返回
          this.Jump('/member')
          // this.isSubmit = false
        }
      }),
      window.addEventListener('wxHide', () => {
        this.remark = 2
      })
    }
  },
  methods: {
    Jump(url, data) {
      this.$JumpPath(this, url, data)
    },
    // 显示备注
    showDesc(desc) {
      // console.log(desc)
      if (!desc) return false
      this.dialogVisible = true
      this.dialogDesc = desc
    },
    /**
     * 支付的全部数据
     */
    paymentData(val) {
      this.needProof = val.need_proof
      this.gathering_info = val.gathering_info
      this.paymentDataAll = val
      this.$nextTick(() => {
        const that = this

        //修改富文本中a标签的样式——产品需求
        document.querySelectorAll('.gathering-info-fulltext a').forEach(function(elem, ind) {
          elem.style.textDecoration = 'underline'
          elem.style.color = '#4381E6'
        })

        //图片放大预览
        that.img_array = []
        // 获取所有可以预览的图片
        document.querySelectorAll('.gathering-info-fulltext img').forEach(function(elem, ind) {
          that.img_array.push(elem.src)
        })
        // 给图片绑定点击事件
        document.querySelectorAll('.gathering-info-fulltext img').forEach(function(elem, ind) {
          elem.onclick = function(e) {
            let _index = 0
            // 获取当前点击的是第几张图片
            that.img_array.forEach(function(_src, index) {
              if (_src == e.target.src) {
                _index = index
              }
            })
            // TODO 小程序图片预览
            wx.previewImage({
              current: e.target.src, //当前图片地址
              urls: that.img_array,  //所有要预览的图片的地址集合数组形式
            })
          }
        })
        // TODO 小程序对于空的p标签特殊处理
        document.querySelectorAll('.gathering-info-fulltext p').forEach(function(elem, ind) {
          if (!elem.innerText) {
            elem.style.lineHeight = 1.5
            elem.style.fontSize = '14px'
          }
        })
        // TODO 装修了a标签有跳转链接 使用openPage跳转
        document.querySelectorAll('.gathering-info-fulltext a').forEach(function(elem, ind) {
          const _href = elem.getAttribute('href')
          if (_href) {
            elem.setAttribute('href', '')
            elem.onclick = function(e) {
              openPage(_href)
            }
          }
        })
      })
    },
    /**
     * 点击选择充值方式
     */
    handleChangeRecharge() {
      const recharge_type = this.submitData.recharge_type
      if (this.dzYckType == 1) {
        this.submitData.recharge_type = 1
      } else if (this.dzYckType == 2) {
        this.submitData.recharge_type = 2
      }

      if (recharge_type == 2) {
        // 充值到订货商预存款，只支持微信和支付宝支付
        this.$refs.payments.showJdpay = false
        this.$refs.payments.showYlPay = false
        this.$refs.payments.showPayPalPay = false
        this.$refs.payments.showBeiBaoPal = false
        this.$refs.payments.showPeerPal = false
        this.$refs.payments.showYeePal = false
        this.$refs.payments.showNewYeePal = false
        this.$refs.payments.showKltPal = false
        this.$refs.payments.showKqPay = false
        this.$refs.payments.showHdfkPay = false
        if (this.dzYckType == 1 || this.dzYckType == 2) {
          this.$refs.payments.showXxPay = true
        } else {
          this.$refs.payments.showXxPay = false
        }
        this.$refs.payments.showHtPay = false
        this.$refs.payments.showGlobalAlipay = false
        this.$refs.payments.showCloudPay = false
        this.$refs.payments.showTlWxPay = false
        this.$refs.payments.showTlAliPay = false
        this.$refs.payments.showGoAllPay = false
        this.$refs.payments.is_dhs_deposit = 1
        this.$refs.payments.payTypeFn()
        this.$refs.payments.defaultCheckedFn(this.paymentDataAll)
      } else {
        this.$refs.payments.is_dhs_deposit = 0
        this.$refs.payments.payTypeFn()
      }
    },
    /**
     * 立即充值按钮事件
     */
    handleClickCharge() {
      if (this.dzYckType == 1) {
        this.submitData.recharge_type == 1
      } else if (this.dzYckType == 2) {
        this.submitData.recharge_type == 2
      }
      const recharge_limit = this.recharge_limit
      const submitData = Object.assign({}, this.submitData, true)
      if (Number(submitData.payment) < Number(recharge_limit)) {
        this.$Error(`充值金额不能小于${recharge_limit}元`)
        return false
      } else {
        // console.log(this.paymentWay)
        if (this.paymentWay == 'wxpay') {
          if (isWeixinCient()) { // 微信环境
            submitData.type = 2
          } else { // 非微信环境
            submitData.type = 12
          }
        } else if (this.paymentWay == 'alipay') {
          submitData.type = 1
        } else if (this.paymentWay == 'jdpay') {
          submitData.type = 3
        } else if (this.paymentWay == 'ylpay') {
          submitData.type = 4
        } else if (this.paymentWay == 'kqpay') {
          submitData.type = 5
        } else if (this.paymentWay == 'xxpay') {
          submitData.type = 6
        } else if (this.paymentWay == 'cloudPay') { // 定制云闪付
          submitData.type = 17
        } else if (this.paymentWay == 'globalAlipay') { // 国际支付宝
          submitData.type = 15
          submitData.global_alipay_currency = this.global_alipay_currency
        } else if (this.paymentWay == 'htwxpay') { // 定制 hante
          submitData.type = 16
          submitData.hantepay = 1
        } else if (this.paymentWay == 'htAlipay') { // 定制 hante
          submitData.type = 16
          submitData.hantepay = 2
        } else if (this.paymentWay == 'tlwxpay') { // 通联支付
          submitData.type = 19
          submitData.payment_type = 1
        } else if (this.paymentWay == 'tlAlipay') { // 通联支付
          submitData.type = 19
          submitData.payment_type = 2
        } else if (this.paymentWay == 'goallpay') { //
          submitData.type = 20
        } else if (this.paymentWay == 'Alipay') {
          submitData.type = 21
        } else if (this.paymentWay == 'UnionPay') {
          submitData.type = 22
        } else if (this.paymentWay == 'WeChatPay') {
          submitData.type = 23
        } else if (this.paymentWay == 'tlfzWxpay') {
          submitData.type = 26
          submitData.tlfz_pay_type = 1
        } else if (this.paymentWay == 'tlfzAlipay') {
          submitData.type = 26
          submitData.tlfz_pay_type = 2
        } else if (this.paymentWay == 'HipoWxPay') { // HipoPay
          submitData.type = 27
        } else if (this.paymentWay == 'JoinWeChatPay') { // 汇聚支付 微信
          submitData.type = 29
        } else if (this.paymentWay == 'hffzWxpay') { // 汇付分账 -- 微信
          submitData.type = 34
          submitData.adapay_pay_type = 2
        } else if (this.paymentWay == 'jhWeChatPay') {
          submitData.type = 48
        }
      }
      if(this.ltnsStatus && submitData.type != 6) {
         this.$Error(`请选择支付方式`)
         return false
      }
      submitData.recharge_code = this.recharge_code // 随机数
      // 需要上传凭证
      if (this.paymentWay == 'xxpay' && this.needProof == 1 && (this.submitData.recharge_type != 2 || this.dzYckType > 0)) {
        Store.save('rechargeData', submitData)
        this.$JumpName(this, 'recharge-proof')
      } else {
        if (this.tlfz_have_person_signed == 0) {
          this.$JumpName(this, 'tlQualification')
          return false
        }
        this.balanceRechargeFn(submitData)
      }
    },
    /**
     * 选中国际支付宝抛出的值
     */
    globalAlipay(val) {
      this.global_alipay_currency = val
    },
    /**
     * 立即充值方法
     */
    balanceRechargeFn(param) {
      this.$loadingWrap.show()
      setTimeout(() => {
        this.$loadingWrap.close()
      }, 50000)
      balanceRecharge(param).then(res => {
        this.$loadingWrap.close()
        if (res.status == 1) {
          // TODO 小程序微信支付处理
            if (this.paymentWay == 'wxpay' && res.data.jsApiParameters) {
              if (res.data.redirect_url) {
                smallpay.wxOrderPay(res.data.jsApiParameters,'',res.data.redirect_url)
              } else {
                smallpay.wxOrderPay(res.data.jsApiParameters)
              }
            } else if (this.paymentWay == 'xxpay') {
              //  线下支付的跳转
              openPage(res.data)
            } else if (this.paymentWay == 'HipoWxPay') {
              // HipoPay 微信支付
              smallpay.wxOrderPay(res.data.HipoPayParams, '', res.data.redirect_url)
            } else if (this.paymentWay == 'tlfzWxpay') {
              if (res.data.is_mini_vsp) {
                this.Jump('/buyTonglianWait',{ order_id: res.data.balance_id, pay_type: 2 })
              } else {
                smallpay.wxOrderPay(res.data.jsApiParameters,'',res.data.redirect_url)
              }
            } else if (this.paymentWay == 'tlwxpay') {
              smallpay.wxOrderPay(res.data.jsApiParameters,'',res.data.redirect_url)
            } else if (this.paymentWay == 'JoinWeChatPay' && res.data.jsApiParameters) {
              smallpay.wxOrderPay(res.data.jsApiParameters)
            } else if (this.paymentWay == 'jhWeChatPay' && res.data.jsApiParameters) {
              smallpay.wxOrderPay(res.data.jsApiParameters)
            } else if (this.paymentWay == 'hffzWxpay' && res.data.jsApiParameters) {
              if (small.wxCache('adapayPlugVersion') == 'jump_adapay_mini') {
                const jsApiParameters = typeof res.data.jsApiParameters == 'object' ? res.data.jsApiParameters: JSON.parse(res.data.jsApiParameters)
                this.hfAppId = jsApiParameters.wx_app_id
                const that = this
                wx.navigateToMiniProgram({
                  appId: jsApiParameters.wx_app_id,
                  path: jsApiParameters.miniapp_path,
                  success(res) {
                    // 打开成功
                    // console.log(res)
                  },
                  fail(error) {
                    // this.$Error('跳转失败')
                    that.Jump('/member')
                  }
                })
              } else if (small.wxCache('adapayPlugVersion') == 'self') {
                smallpay.wxOrderPay(res.data.jsApiParameters,'',res.data.redirect_url)
              } else {
                const adapayPlugin = small.wxCache('adapayPlugVersion') == 'new' ? requirePlugin("Adapay") : requirePlugin("adapay-plugin")
                // 汇付分账
                const hfPay= res.data.jsApiParameters
                if (hfPay) {
                  adapayPlugin.requestPay(hfPay, this.paySuccess, this.payError);
                }
              }
            }

        } else {
          this.$Error(res.msg)
        }
      })
    },
    // 汇付支付成功
    paySuccess() {
      this.$Error('支付成功！')
      this.submitData.payment = ''
    },
    // 汇付支付失败
    payError() {
      this.$Error('支付失败！')
    }
  },
  computed: {
    // 获取自定义符号
    ...mapGetters(['mSymbol']),
    btnText() {
      let text = '确认充值'
      if (this.paymentWay == 'xxpay' && this.needProof == 1 && (this.submitData.recharge_type != 2 || this.dzYckType > 0)) {
        text = '上传凭证'
      }
      return text
    }
  },
  created() {
    if (this.$route.query.type) {
      this.dzYckType = this.$route.query.type
    }
    let shop = small.globalData.shopId
    const ltsn_dz = this.$_shop('$_ltsn_dz', shop)
    this.ltnsStatus = ltsn_dz
    if(this.ltnsStatus) {
      this.paymentWay = 'xxpay'
    }
    if (small.wxCache('adapayPlugVersion') == 'jump_adapay_mini') {
      this.remark = 1
    }
  }
})
</script>

<style lang="scss">
@import "src/styles/mixin.scss";
@import "src/styles/variables";
.non-shopcard-wrapper{
  .gathering-info{
    font-size:28px;
    line-height:1.5;
    &-fulltext{
      width: 100%;
      img{
        max-width: 100%;
        width: 100%;
      }
    }
    a{
      color:#4381E6;
      text-decoration:underline;
    }
  }
}

.miniprogram-root {
  .van-radio__icon {
    height: 40px;
  }
  .van-popup__close-icon{
    font-size: 28rpx;
  }
}
.recharge-wrapper {
  .item-box {
    background: #fff;
    margin: 20px 20px 0 20px;
    border-radius: 20px;
    padding: 30px;
    .payment-wrap {
      &:last-child {
        border: 0;
      }
    }
  }
  label {
    font-weight: normal;
    &.item-title {
      padding: 0;
    }
  }
  .item-title {
    height: auto;
    margin: 0;
    line-height: 50px;
    font-size: 32px;
    color: #333;
    img {
      width: 30px;
      height: 30px;
      vertical-align: middle;
      margin-right: 10px;
      margin-top: -5px;
    }
    &.recharge-type {
      padding-bottom: 0;
    }
  }
  .log-title {
    height: auto;
    margin: 0;
    line-height: 50px;
    font-size: 32px;
    font-weight:bold;
    color: #333;
    position: relative;
    padding-left: 20px;
    &::before {
      content: "";
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 5px;
      height: 28px;
      background: rgba(243, 21, 43, 1);
    }
  }
  .item-label {
    display: inline-block;
    position: relative;
    top: 10px;
    .van-radio {
      display: inline-flex;
      vertical-align: -2px;
      &:first-child {
        margin-right: 20px;
      }
      .radio-txt {
        font-size: 28px;
        @include alignTop;
      }
    }
  }
  .recharge-type-label {
    // vertical-align: baseline;
    font-size: 28px;
    line-height: 36px;
    input[type="radio"] {
      vertical-align: -1px;
    }
  }
  .recharge-search {
    display: block;
    font-size: 28px;
    padding-top: 20px;
    i {
      display:inline-block;
      padding-right: 20px;
      line-height: 60px;
      font-size:40px;
      font-weight:bold;
      color: #333333;
    }
    input {
      border: 0;
      outline: 0;
      width: 88%;
      height: 60px;
      font-size:40px;
    }
  }
  .show-tip {
    .tip-txt {
      li {
        color: #666666;
        // padding: 10px 0;
        font-size: 28px;
        line-height: 40px;
        border-bottom: 1px solid #ededed;
        position: relative;
        padding: 30px 30px 30px 0;
        overflow: hidden;
        i{
          width: 11px;
          height: 18px;
          position: absolute;
          right: 0;
          top: 50%;
          transform: translateY(-50%);
          background: url('https://img.wifenxiao.com/h5-wfx/images/user/member/right.png') center/cover no-repeat;
        }
      }
      ul:last-child {
        li:last-child{
          border-bottom: 0;
        }
      }
    }
    .tip-txt-detail {
      overflow: hidden;
      max-height: 240px;
      margin-bottom: 10px;
      &.heightAuto {
        height: auto;
        max-height: none;
      }
    }
    .tip-txt-btn {
      // display: none;
      height: 60px;
      padding-top: 20px;
      border-top: 1px solid #ededed;
      height: 80px;
      line-height: 60px;
      font-size: 24px;
      text-align: center;
      color: #999;
      .icon {
        font-size: 28px;
        margin-left: 6px;
        transform: rotate(90deg);
      }
    }
  }
  .recharge-btn {
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 13;
    width: 100%;
    padding: 10px 20px;
    text-align: center;
    background: #fff;
    .submit-btn {
      height: 80px;
      width: 100%;
      line-height: 80px;
      color: #fff;
      font-size: 32px;
      border-radius: 50px;
    }
  }
    .desc-pop{
    padding: 0 20px 100px;
    .desc-wrap{
      .desc-title{
        font-size: 32px;
        text-align: center;
        // font-weight: bold;
        line-height: 110px;
        color: #333333;
        border-bottom: 1px solid #F0F0F0;
      }
      .decs-content{
        padding: 100px 0;
        text-align: center;
        font-size: 32px;
        color: #999999;
      }
      .decs-close{
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 700px;
        line-height: 76px;
        background: linear-gradient(270deg, #E90104 0%, #FE1B49 100%, #FE1B49 100%);
        opacity: 1;
        border-radius: 38px;
        text-align: center;
        font-size: 28px;
        color: #fff;
      }
    }
  }
}
</style>
